﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


namespace Eacademy.Library.Helpers
{
    public static class UserHelper
    {
        public static int GetUserTypeId(string userType)
        {
            if (!String.IsNullOrEmpty(userType))
            {
                if (userType == UserTypes.MentorLiteral || userType == UserTypes.StudentLiteral)
                {
                    switch (userType)
                    {
                        case UserTypes.MentorLiteral:
                            return UserTypes.Mentor;
                        case UserTypes.StudentLiteral:
                            return UserTypes.Student;
                    }
                }
            }
            return 0;
        }

        public static string GetUserTypeById(int? userTypeId = 0)
        {
            switch (userTypeId)
            {
                case UserTypes.Mentor:
                    return UserTypes.MentorLiteral;
                case UserTypes.Student:
                    return UserTypes.StudentLiteral;
                case UserTypes.Admin:
                    return UserTypes.AdminLiteral;
            }

            return String.Empty;
        }
    }
}